home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / libsrc~1.z / libsrc~1 / getppid.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-12-28  |  392 b   |  22 lines

  1. /*
  2. EFTH Minix report #23  - July 1988 -  POSIX getppid(2)
  3.  
  4. This is an implementation of getppid(2) - "get parent's
  5. process id". Please consider this a public domain program.
  6. */
  7.  
  8. #include "lib.h"
  9. #ifndef NIL_PTR
  10. #define NIL_PTR ((void *) 0)
  11. #endif
  12.  
  13. PUBLIC int getppid()
  14. {
  15.   int p = callm1(MM, GETPID, 0, 0, 0, NIL_PTR, NIL_PTR, NIL_PTR);
  16.  
  17.   if ( p < 0 ) return ( p );
  18.  
  19.   return( M.m2_i1 );
  20. }
  21.  
  22.